import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter);
// 访问链接
const routes = [
    {
        path: '/home',
        name: 'home',
        component: ()=> import("../views/home.vue"),
        meta: {
            title: '股权质押'
        }
    },
    {
        path: '/situationPage',
        name: 'situationPage',
        component: ()=> import("../views/situationPage.vue"),
        meta: {
            title: '股权质押市场概况'
        }
    },
    {
        path: '/ratePage',
        name: 'ratePage',
        component: ()=> import("../views/ratePage.vue"),
        meta: {
            title: '上市公司质押比例'
        }
    },
    {
        path: '/holderPage',
        name: 'holderPage',
        component: ()=> import("../views/holderPage.vue"),
        meta: {
            title: '重要股东股权质押情况'
        }
    },
    {
        path: '/organizationPage/:type',
        name: 'organizationPage',
        component: ()=> import("../views/organizationPage.vue"),
        meta: {
            title: '股权质押分布统计'
        }
    },
];
const router = new VueRouter({
    linkActiveClass: 'active',
    base: process.env.BASE_URL,
    routes
});
//路由后置钩子
router.afterEach((to, from) => {
    //设置头部标题
    if (to.meta.title) document.title = to.meta.title;
});
export default router;